<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('产犊记录列表')" />
</head>
<body class="gray-bg">

<div class="ibox-title">

	<h5>产犊信息:&nbsp;&nbsp;&nbsp;&nbsp;</h5>
	<h5>耳号：</h5><h5 th:text="${ncCowsFiles.cowCode}"></h5>
	<h5>&nbsp;&nbsp;&nbsp;&nbsp;牛龄：</h5><h5 th:text="${ncCowsFiles.cowAge}-*{#dates.format(ncCowsFiles.birthDay, 'yyyy ')}"></h5>
</div>

     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<!--<ul>
							<li>
								发情时间：<input type="text" name="fqDate"/>
							</li>

							<li>
								配种时间：<input type="text" name="pzDate"/>
							</li>

							<li>
								产犊时间：<input type="text" name="givebirthTime"/>
							</li>

							<li>
								犊牛性别：<input type="text" name="childGender"/>
							</li>

							<li>
								耳号：<input type="text" name="childCode"/>
							</li>

							<li>
								犊牛体重：<input type="text" name="childWeight"/>
							</li>

							<li>
								更新时间：<input type="text" name="updateTime"/>
							</li>

							<li>
								淘汰时间：<input type="text" name="eliminateTime"/>
							</li>

							<li>
								淘汰原因：<input type="text" name="eliminateReason"/>
							</li>

							<li>
								创建时间：<input type="text" name="createTime"/>
							</li>

							<li>
								创建者：<input type="text" name="createBy"/>
							</li>

							<li>
								备注：<input type="text" name="remark"/>
							</li>

							<li>
								牛犊子id （主键）：<input type="text" name="birthId"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>-->
					</div>
				</form>
			</div>

	        <div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:ncCowsBirth:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:ncCowsBirth:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:ncCowsBirth:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:ncCowsBirth:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:ncCowsBirth:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:ncCowsBirth:remove')}]];
        var prefix = ctx + "system/ncCowsBirth";

        $(function() {
			var datas = [[${@dict.getType('childGender')}]];
            var options = {
				uniqueId: "birthId",
                url: prefix + "/list?cowId="+[[${ncCowsFiles.cowId}]],
                createUrl: prefix + "/add?cowId="+[[${ncCowsFiles.cowId}]],
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export?cowId="+[[${ncCowsFiles.cowId}]],
                modalName: "产犊记录",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'cowId',
					title : '牛id',
					visible: false
				},
				{
					field : 'fqDate',
					title : '发情时间',
					sortable: true,
					formatter: function(value, row, index) {
						return dateFtt(value,'yyyy-MM-dd hh:mm:ss')
					}
				},
				{
					field : 'pzDate',
					title : '配种时间',
					sortable: true,
					formatter: function(value, row, index) {
						return dateFtt(value,'yyyy-MM-dd hh:mm:ss')
					}
				},
				{
					field : 'givebirthTime',
					title : '产犊时间',
					sortable: true,
					formatter: function(value, row, index) {
						return dateFtt(value,'yyyy-MM-dd hh:mm:ss')
					}
				},
				{
					field : 'childGender',
					title : '犊牛性别',
					sortable: true,
					formatter: function(value, item, index) {
						return $.table.selectDictLabel(datas,item.childGender);
					}
				},
				{
					field : 'childCode',
					title : '耳号',
					sortable: true
				},
				{
					field : 'childWeight',
					title : '犊牛体重',
					sortable: true
				},
				{
					field : 'updateTime',
					title : '更新时间',
					sortable: true
				},
				{
					field : 'eliminateTime',
					title : '淘汰时间',
					sortable: true
				},
				{
					field : 'eliminateReason',
					title : '淘汰原因',
					sortable: true
				},
				{
					field : 'remark',
					title : '备注',
					sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value);
                    }
				},
				{
					field : 'birthId',
					title : '牛犊子id （主键）',
					sortable: true,
					visible: false
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.birthId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.birthId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>